package org.beiji.userservice.controller;


import lombok.RequiredArgsConstructor;
import org.beiji.frameworks.convention.result.Result;
import org.beiji.frameworks.web.Results;
import org.beiji.userservice.dto.req.UserLoginReqDTO;
import org.beiji.userservice.dto.resp.UserLoginRespDTO;
import org.beiji.userservice.service.UserLoginService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
public class UserLoginController {


    private final UserLoginService userLoginService;


    @RequestMapping("/v1/login")
    public Result<UserLoginRespDTO> login(@RequestBody UserLoginReqDTO userLoginReqDTO){

        UserLoginRespDTO userLoginRespDTO = userLoginService.login(userLoginReqDTO);
        return Results.success(userLoginRespDTO);
    }








}
